
/***
    {
      "pagePath": "pages/decor/news/news",
      "text": "资讯",
      "iconPath": "images/tabbar/z.png",
      "selectedIconPath": "images/tabbar/z1.png"
    },
 ***/
var con = require("../../../utils/data.js");
var app = getApp()
Page({
  data: {
    type: [],
    list: [],
    galler: []
  },
  onLoad: function () {
    var that = this;
    
    var oneRequest =
      { "data": { "status": "1", "info": [{ "id": "17", "wxappid": "6", "info": "装修啦", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz_banner_04.jpg", "url": "测试地址" }, { "id": "18", "wxappid": "6", "info": "专修", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz_banner_02.jpg", "url": "测试地址" }, { "id": "19", "wxappid": "6", "info": "地方", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz_banner_03.jpg", "url": "测试地址" }, { "id": "20", "wxappid": "6", "info": "1231", "img": "http://www.weiyunyi.com/Uploads/20170714/596875b286885.png", "url": "测试地址" }] }, "header": { "Server": "NWSs", "Date": "Thu, 28 Dec 2017 01:37:53 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "635", "Connection": "keep-alive", "Cache-Control": "must-revalidate, no-store", "Pragma": "no-cache", "X-Powered-By": "PHP/5.4.33,ASP.NET", "Set-Cookie": "PHPSESSID=5lfg5v8qa0k7afrpg23l3hg8n0; path=/", "X-NWS-LOG-UUID": "2031e831-9d26-471b-acc3-dd67f2329b27", "X-Daa-Tunnel": "hop_count=2" }, "statusCode": 200, "errMsg": "request:ok" };
       that.setData({
         list: oneRequest.data.info
        });
  
 

    var centerBanner = [
      { "id": "1", "wxappid": "6", "name": "套装门", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz_b_b.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170714/59687aef0f7e0.jpg", "type": null },
      { "id": "2", "wxappid": "6", "name": "钛合金", "img": "http://www.weiyunyi.com/Uploads/20170714/59687afa70dfb.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170715/5969ccc2650ec.png", "type": null },
      { "id": "3", "wxappid": "6", "name": "整体衣柜", "img": "http://www.weiyunyi.com/Uploads/20170714/59687b1e6b403.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170714/59687b278edc6.jpg", "type": null },
      { "id": "4", "wxappid": "6", "name": "生活美食", "img": "http://www.weiyunyi.com/Uploads/20170714/59687b38ee272.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170714/59687b48942d5.jpg", "type": null }];

      that.setData({
        type: centerBanner
        });
 
      var threeRequest = [
        { "id": "6", "wxappid": "6", "name": "实木套装门", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz-%E5%AE%9E%E6%9C%A8%E5%A5%97%E8%A3%85%E9%97%A84.jpg?imageView2/1/w/750/h/350/format/jpg/interlace/0/q/100|watermark/2/text/6YOR5Lyg5piOMTM4ODIwNTU2NjI=/font/5a6L5L2T/fontsize/1100/fill/I0VGRUZFRg==/dissolve/92/gravity/Center", "intro": "公司环境介绍", "createtime": "1500078445" },
        { "id": "18", "wxappid": "6", "name": "整体衣柜", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz-%E6%95%B4%E4%BD%93%E8%A1%A3%E6%9F%9C3.jpg?imageView2/1/w/750/h/350/format/jpg/interlace/0/q/100|watermark/2/text/6YOR5Lyg5piOMTM4ODIwNTU2NjI=/font/5a6L5L2T/fontsize/1100/fill/I0VGRUZFRg==/dissolve/92/gravity/Center", "intro": "案例1", "createtime": "1500078482" },
        { "id": "11", "wxappid": "6", "name": "甲级防盗门", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz-%E7%94%B2%E7%BA%A7%E9%98%B2%E7%9B%97%E9%97%A82.jpg?imageView2/1/w/750/h/350/format/jpg/interlace/0/q/100|watermark/2/text/6YOR5Lyg5piOMTM4ODIwNTU2NjI=/font/5a6L5L2T/fontsize/1100/fill/I0VGRUZFRg==/dissolve/92/gravity/Center", "intro": "公司案例介绍", "createtime": "1500078508" },
        { "id": "21", "wxappid": "6", "name": "美味醪糟", "img": "http://ow1m1usz0.bkt.clouddn.com/jzdz_lz_t6.jpg", "intro": "装修行业介绍", "createtime": "1500078605" }] ;
    that.setData({
      galler: threeRequest
    })



  },
  bindType: function (e) {
    // console.log(e.currentTarget.dataset.id);
    var len = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../article/article?id=' + len,
    });


 


  },
  bindgaller: function (e) {
    var len = e.currentTarget.dataset.id; 
    wx.navigateTo({
      url: '../article/articleD/articleD?id=' + len
    })
  },
  bookTap: function () {
    wx.makePhoneCall({
      phoneNumber: '13882055662',
      success: function () {
        console.log("拨打电话成功！")
      },
      fail: function () {
        console.log("拨打电话失败！")
      }
    })
  },
  onShareAppMessage: function (res) {

    if (res.from === 'button') {
      // 来自页面内转发按钮
      console.log(res.target)
    }
    return {
      title: this.data.DefaultData.details.details_subject,
      path: '/pages/decor/home/home',
      success: function (res) {
        // 转发成功
        console.log("转发已经成功");
      },
      fail: function (res) {
        console.log("转发已经失败");
      }
    }
  },
})

